unit SaidaSearchFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, Buttons, StdCtrls, DBGrids, EditBtn, MainSearchFr;

type

  { TSaidaSearchFrame }

  TSaidaSearchFrame = class(TMainSearchFrame)
    data: TDateEdit;
    nome_pessoa: TEdit;
    id_saida: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label4: TLabel;
   procedure LocalizarButtonClick(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses SaidaDM, QueryConditions;

{ TSaidaSearchFrame }

procedure TSaidaSearchFrame.LocalizarButtonClick(Sender: TObject);
var
  condicoes: TQueryConditions;
begin
    condicoes := TQueryConditions.Create(CON_AND);
    condicoes.Add('s.id_saida', id_saida.Text);
    condicoes.AddJoinField('p.id_pessoa', 's.id_usuario');
    condicoes.Add('p.nome_pessoa', nome_pessoa.Text);
    condicoes.Add('data', data.Text);
    SaidaData.Search(Condicoes, 'saida as s, pessoa as p');
end;

initialization
  {$I saidasearchfr.lrs}

end.

